package com.foryou.wechat.controller;

import com.foryou.wechat.service.PlaceTypeService;
import com.foryou.wechat.utils.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Lee.
 */
@RestController
@RequestMapping("/v/place/type")
public class PlaceTypeController {

    @Autowired
    private PlaceTypeService placeTypeService;

    @PostMapping("/addPlaceType")
    public Response addPlaceType(String name) {
        return placeTypeService.addPlaceType(name);
    }

    @PostMapping("/updatePlaceType")
    public Response updatePlaceType(Long placeTypeId,String name) {
        return placeTypeService.updatePlaceType(placeTypeId,name);
    }

    @PostMapping("/enabledPlaceType")
    public Response enabledPlaceType(Long placeTypeId) {
        return placeTypeService.enabledPlaceType(placeTypeId);
    }

    @PostMapping("/deletePlaceType")
    public Response deletePlaceType(Long placeTypeId) {
        return placeTypeService.deletePlaceType(placeTypeId);
    }

    @GetMapping("/getPlaceTypeInfo")
    public Response getPlaceTypeInfo(Long placeTypeId) {
        return placeTypeService.getPlaceTypeInfo(placeTypeId);
    }

    @GetMapping("/getPlaceTypeList")
    public Response getPlaceTypeList() {
        return placeTypeService.getPlaceTypeList();
    }
}
